
using UnityEngine;
using UnityEngine.SceneManagement;

public class UnitManager
{
    private static UnitManager instance = new UnitManager();
    public static UnitManager Instance => instance;

    public FSM Player;


    public GameObject CreatePlayer()
    {
        if (Player == null)
        {
            var go =  ResourceManager.Instance.Instantiate<GameObject>("Unit/1001");

            var birthPoint = GameObject.Find("BirthPoint");
            var birthPoint2 = birthPoint.transform.GetChild(0);
            go.transform.position = birthPoint.transform.GetChild(0).position;

            Player = go.GetComponent<FSM>();
            Player.Ai = false;
        }
        return Player.gameObject;
    }
}